package com.aw.baselib.base;

import com.aw.baselib.bean.CommonListBean;

/**
 * Created by hzw
 */

public class AwResponseBean<T> extends CommonListBean {

    private static final int CODE_SUCCESS = 0;
    private static final int CODE_TOKEN_ERROR = 401;

    private String msg;
    private T data;

    private String message;
    private int code = -1;


    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public boolean isSuccess() {
        return code == CODE_SUCCESS;
    }

    public boolean isTokenError() {
        return code == CODE_TOKEN_ERROR;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    @Override
    public String toString() {
        return "AwResponseBean{" +
                "msg='" + msg + '\'' +
                ", data=" + data +
                ", message='" + message + '\'' +
                ", code=" + code +
                '}';
    }
}
